<?php
class Entries extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		$this->load->spark('ion_auth/2.3.2');
		$this->load->database();
	}

	public function index()
	{
	
		//is the user logged in?
		if (!$this->ion_auth->logged_in())
		{
			//redirect them back to the page they came from
			redirect($this->config->item('base_url'), 'refresh');
		}
		$user = $this->ion_auth->user()->row();
		$this->load->model('entries_model');
		$entries = $this->entries_model->get_entries();
		
		$data = array('title' => 'Kivaou', 'navbar_content'=>'teacher/teacher_navbar','navbar_style'=>'navbar','navbar_inverse_style'=>'navbar-inverse','navbar_inner_style'=>'navbar-inner','main_content'=>'teacher/entries_v','user'=>$user,'entries'=>$entries);
		$this->load->view('templates/home', $data);

	}
	
	public function create(){
	}
}